<?php
	session_start();
	define('SMARTY_DIR', 'lib/Smarty/libs/');
	include (SMARTY_DIR.'Smarty.class.php');
	include 'lib/mlib/Db.php';
	include 'lib/mlib/Agenda.php';
	include 'lib/mlib/Usuario.php';
	
	$smarty = new Smarty();
	$smarty->cache_dir = "cache";
	$smarty->config_dir = "configs";
	$smarty->compile_dir = "templates_c";
	$smarty->template_dir = "templates";
	
	if(@!$_SESSION['logado'] and $_SERVER['SCRIPT_NAME']!='/agenda_smarty/auth.php'){
		header('location: auth.php');
	}
	
	$bd = new Db();
	$bd->connect();
	$agenda = new Agenda($bd,'agenda');
	$usuario = new Usuario($bd);
?>
